import * as actionTypes from './constants'

const initialState = {
  counter: 10,
}


function reducer (state = initialState, action) {
  switch (action.type) {
    case actionTypes.ADDCOUNTER:
      return { ...state, counter: state.counter + action.counter }
    case actionTypes.SUBCOUNTER:
      return { ...state, counter: state.counter + action.counter }
    default:
      return state;
  }
}

export default reducer
